var StartScene01 = cc.Scene.extend({
	onEnter:function () {
		this._super();
		cc.spriteFrameCache.addSpriteFrames(res01.home_p);
		var back_layer = new StartBackLayer01(this);
		back_layer.menu.setLocalZOrder(-1);
		
		var layer = new StartLayer01();
		this.addChild(layer,2);
		layer.bake();
	},
	backClicked: function () {// 返回按钮
		cc.director.end();
	},
	menuClicked:function(){// 菜单按钮
	}
});

var StartLayer01 = cc.Layer.extend({
	ctor:function () {
		this._super();
		var posX = gg.width * 0.25;
		var posY = gg.height * 0.4;

		var _tipItem = new cc.MenuItemImage("#home_lead1.png","#home_lead2.png",this.eventMenuCallback,this);
		var _realItem = new cc.MenuItemImage("#home_real1.png","#home_real2.png",this.eventMenuCallback,this);
		_tipItem.setPosition(cc.p(posX, posY));
		posX = gg.width - gg.width * 0.25;
		_realItem.setPosition(cc.p(posX, posY));
		
		var menu = new cc.Menu();
		menu.addChild(_tipItem, 1, TAG_LEAD);
		menu.addChild(_realItem, 1, TAG_REAL);
		menu.setPosition( cc.p(0, 0) );
		this.addChild(menu, 1);
		
		this.loadVersion();
		this.loadBack(menu);
		return true;
	},
	loadVersion : function(){
		version = new cc.LabelBMFont(gg.version, res01.font_f);
		version.setColor(cc.color(0,0,0,0));
		version.setPosition(980, 25);
		this.addChild(version);
	},
	loadBack: function(menu){
		var backItem = new cc.MenuItemImage("#button/back.png","#button/back.png",this.eventMenuCallback,this);
		menu.addChild(backItem, 1, TAG_CLOSE);
		backItem.setPosition(984, 40);
	},
	eventMenuCallback: function(pSender) {
		switch (pSender.getTag()){
		case TAG_LEAD:
			cc.log("进入引导模式");
			gg.teach_type = TAG_LEAD;
			$.runScene(new RunScene());
			break;
		case TAG_REAL:
			cc.log("进入实战模式");
			gg.teach_type = TAG_REAL;
			$.runScene(new RunScene());
			break;
		case TAG_CLOSE:
			ch.howToGo(OP_TYPE_BACK);
			break;
		default:
			break;
		}
	},
	
});